package ar.fi.uba.celdas.ambiente.gui;

import java.awt.Point;

import ar.fi.uba.celdas.ambiente.modelo.IRobot;
import ar.fi.uba.celdas.ambiente.modelo.IRobotListener;

public class MockRobot implements IRobot {

	int posIndex = 0;
	Point [] pos = new Point[] {
			new Point(0,0),
			new Point(1,0),
			new Point(2,0),
			new Point(3,0),
			new Point(3,1),
			new Point(3,2),
			new Point(2,2),
			new Point(2,3),
			new Point(2,2),
			new Point(3,2),
			new Point(3,1),
			new Point(3,0),
			new Point(2,0),
			new Point(1,0),			
	};
	Point [] dir = new Point[] {
			new Point(0,-1),
			new Point(0,1),
			new Point(0,-1),
			new Point(0,1),
			new Point(1,0),
			new Point(0,1),
			new Point(-1,0),
			new Point(0,-1),
			new Point(1,0),
			new Point(-1,0),
			new Point(-1,0),
			new Point(0,-1),
			new Point(1,0),
			new Point(0,1)				
	};
	
	@Override
	public void mover() {
		/*
		try {
			Thread.sleep(500);
		} catch (InterruptedException e) {
			e.printStackTrace();
		}*/
		
		if (posIndex < pos.length-1)
			++posIndex;
		else
			posIndex = 0;
	}

	@Override
	public Point getPosicion() {
		return new Point(pos[posIndex].x + 16,pos[posIndex].y + 16);
	}

	@Override
	public Point getVectorDireccion() {
		return dir[posIndex];
	}

	@Override
	public void addListener(IRobotListener listener) {
		// TODO Auto-generated method stub
		
	}

}
